package com.jdbctemplate.base;

import com.jdbctemplate.dao.AccountDaoImple;
import com.jdbctemplate.dao.IAccoutDao;
import com.jdbctemplate.domain.Account;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class test {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("jdbctem.xml");
        /*IAccoutDao adi=(IAccoutDao) ac.getBean("accountdao");*/
        IAccoutDao adi=ac.getBean("accountdao",IAccoutDao.class);
        Account findbyname=adi.findbyname("aaa");
        System.out.println("findbyname"+findbyname);
        Account findbyid= adi.findbyid(1);
        System.out.println("findbyid"+findbyid);
        findbyid.setMoney(133f);
        adi.update(findbyid);
    }
}
